package com.han;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.time.LocalDateTime;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;


@SpringBootApplication
@EnableScheduling
public class ReminderApplication {
    public static void main(String[] args) {
        SpringApplication.run(ReminderApplication.class, args);
    }


    // 使用@Scheduled注解来实现每30分钟提醒一次
    @Scheduled(fixedRate = 1000 * 60 * 30)
    private void remindTask() {
        System.out.println("提醒时间：" + LocalDateTime.now());
        // 在这里添加具体的提醒逻辑
    }
}
